﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using XStudio.XCRF.Resources.Items;

namespace XStudio.XCRF.Web.Models.Items
{
    public class MarkInfo
    {
        /// <summary>
        /// Mark
        /// </summary>
        /// <summary>
        /// 对应键值
        /// </summary>
        public byte? Value { get; set; }
        private static IEnumerable<SelectListItem> _SelectListItems;
        public static IEnumerable<SelectListItem> SelectListItems
        {
            get
            {
                if (_SelectListItems == null)
                {
                    List<SelectListItem> items = new List<SelectListItem>();
                    byte[] keys = {0, 1, 2, 3, 4, 5, 6};
                    foreach (byte key in keys)
                        items.Add(new SelectListItem
                        {
                            Text = MarkResource.ResourceManager.GetString("_" + key),
                            Value = key.ToString()
                        });
                    _SelectListItems = items;
                }
                return _SelectListItems;
            }
        }

        public static string GetName(byte key)
        {
            return MarkResource.ResourceManager.GetString("_" + key);
        }
    }
}